Default Style Objects
When you call theGXNewStyle
function, which is described in the chapter "Style Objects" in Inside Macintosh: QuickDraw GX Objects, QuickDraw GX creates and returns a new style object. All of the new style object's properties are set to standard initial values. Once you have created a new style object, you can change the values of its properties, but you cannot change the behavior of theGXNewStyle
function itself; it always returns a style object with these values for the geometric style properties:
The chapter "Typographic Styles" in Inside Macintosh: QuickDraw GX Typography discusses the default style values for the typographic style properties.
- owner count: 1
- tag list: no tags
- style attributes: no attributes
- curve error: 0.0
- pen width: 0.0
- cap
- cap attributes: no attributes
- start cap: none
- end cap: none
- join
- join attributes: no attributes
- join: none
- join miter:
Fixed1
- dash
- dash attributes: no attributes
- dash: none
- dash advance: 0.0
- dash phase: 0.0
- dash scale:
Fixed1
- pattern
- pattern attributes: no attributes
- pattern: none
- pattern grid: (0.0,0.0), (0.0,0.0)
Although you cannot change the behavior of the
GXNewStyle
function, QuickDraw GX provides another method for creating new style objects--a method that you can modify. When you create a new shape with theGXNewShape
function, QuickDraw GX returns a copy of the default shape of the requested type. Since you can change the default shapes, you can also change the style objects that they reference.Initially, all of the default shape objects reference the same style object. Whenever you create a new shape, it, too, references this style object. There are two ways in which you can change the style object associated with a new shape:
By calling functions such as
- You can call a function such as
GXSetShapePen
, which makes a copy of the style object specifically for your new shape before changing its pen width.- You can obtain a reference to your new shape's style object by calling the
GXGetShapeStyle
function, and then you can call a function such asGXSetStylePen
, which does not make a copy of the style object. Instead, it affects the style object directly, which, in effect, changes the default style for all the default shapes.
GXSetShapePen
on each of the default shapes, you can create a different style object for each default shape. See the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects for more information about default shapes.